package com.wu.controller;

import com.wu.mapper.OrderMapper;
import com.wu.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/order")
public class orderController {


    @Autowired
    private OrderMapper orderMapper;

    @PostMapping("/save")
    public void save(@RequestBody Order order){
        orderMapper.save(order);
    }


    @GetMapping("/findall/{page}/{limit}")
    public List<Order> findAll(@PathVariable("page") int page, @PathVariable("limit") int limit){
        return orderMapper.findall(page, limit);
    }

    @GetMapping("/index")
    public String gg(){
        return "ddd";
    }

}
